<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>申请状态</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #FFF9C4;
            --primary-dark: #FFECB3;
            --secondary: #FFFDE7;
            --accent: #FFD54F;
            --text: #5D4037;
            --text-light: #8D6E63;
            --success: #81C784;
            --warning: #FFB74D;
            --danger: #E57373;
            --border: rgba(255, 213, 79, 0.3);
        }

        body {
            background-color: var(--secondary);
            color: var(--text);
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        .status-container {
            max-width: 800px;
            margin: 40px auto;
            padding: 30px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        }

        .status-header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border);
        }

        .status-header h1 {
            color: var(--text);
            margin-bottom: 10px;
        }

        .status-header p {
            color: var(--text-light);
        }

        .application-card {
            background: #f9f9f9;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            border: 1px solid var(--border);
        }

        .application-card h3 {
            color: var(--text);
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }

        .application-card p {
            margin-bottom: 10px;
            color: var(--text-light);
        }

        .status-pending {
            color: var(--warning);
            font-weight: 500;
            padding: 4px 10px;
            background: rgba(255, 183, 77, 0.2);
            border-radius: 20px;
        }

        .status-approved {
            color: var(--success);
            font-weight: 500;
            padding: 4px 10px;
            background: rgba(129, 199, 132, 0.2);
            border-radius: 20px;
        }

        .status-rejected {
            color: var(--danger);
            font-weight: 500;
            padding: 4px 10px;
            background: rgba(229, 115, 115, 0.2);
            border-radius: 20px;
        }

        .message {
            margin: 20px 0;
            padding: 15px;
            border-radius: 8px;
            font-weight: 500;
        }

        .success {
            background-color: rgba(129, 199, 132, 0.2);
            color: var(--success);
            border: 1px solid rgba(129, 199, 132, 0.3);
        }

        .error {
            background-color: rgba(229, 115, 115, 0.2);
            color: var(--danger);
            border: 1px solid rgba(229, 115, 115, 0.3);
        }
    </style>
</head>
<body>
<jsp:include page="/WEB-INF/views/user/head.jsp"/>
<div class="status-container">
    <div class="status-header">
        <h1><i class="fas fa-file-alt"></i> 我的服务申请</h1>
        <p>以下是您提交的所有申请记录</p>
    </div>
    <c:if test="${not empty param.success}">
        <div class="message success"><i class="fas fa-check-circle"></i> 申请已通过审核！</div>
    </c:if>
    <c:if test="${not empty param.error}">
        <div class="message error"><i class="fas fa-exclamation-circle"></i> 申请未通过审核！原因：${param.error}</div>
    </c:if>
    <c:forEach items="${applications}" var="app">
        <div class="application-card">
            <h3>申请ID: ${app.application_id}</h3>
            <p><i class="fas fa-tag"></i> 类型: ${app.application_type}</p>
            <p><i class="fas fa-info-circle"></i> 状态:
                <span class="status-${app.status.toLowerCase()}">${app.status}</span>
            </p>
            <p><i class="fas fa-clock"></i> 提交时间: ${app.submitted_at}</p>
            <c:if test="${not empty app.reviewed_at}">
                <p><i class="fas fa-calendar-check"></i> 审核时间: ${app.reviewed_at}</p>
            </c:if>
        </div>
    </c:forEach>
</div>
</body>
</html>